<template>
    <div class="swiper-container swiper1">
        <div class="swiper-wrapper">
            <div class="swiper-slide" v-for="item of banner" :key="item.id">
                <img :src="item.imgUrl" alt="">
            </div>
        </div>
    </div>
</template>

<script>
    import Swiper from 'swiper'
    import {getBanner} from "../../api"

    export default {
        name: "HomeTuiJianSwiperzxw",
        data() {
            return {
                banner: []
            }
        },
        mounted() {
            getBanner('/')
                .then(response => {
                    this.banner = response.data
                })
        },
        updated() {
            new Swiper('.swiper1', {
                autoplay: true,
                loop: true
            });
        },
    }
</script>

<style scoped>
    .swiper1{
        width: 100%;
        border-radius: 10px;
    }
    .swiper-slide > img {
        width: 100%;
    }

</style>